<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('佣金明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>[[#{transactionNo}]]：</label>
                                <input type="text" name="transactionNumber"/>
                            </li>
                            <li>
                                <label>[[#{originalOrderNo}]]：</label>
                                <input type="text" name="orderNo"/>
                            </li>
                            <li>
                                <label>[[#{paymentTime}]]：</label>
                                <input type="text" class="time-input" id="beginPaymentTime" th:placeholder="#{beginTime}" name="params[beginPaymentTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endPaymentTime" th:placeholder="#{beginTime}" name="params[endPaymentTime]" />
                            </li>
                            <li>
                                <label>[[#{createTime}]]：</label>
                                <input type="text" class="time-input" id="beginCreateTime" th:placeholder="#{beginTime}" name="params[beginCreateTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endCreateTime" th:placeholder="#{endTime}" name="params[endCreateTime]" />
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;[[#{search}]]</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;[[#{reset}]]</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">

                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:commission:remove">
                    <i class="fa fa-remove"></i> [[#{delete}]]
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:commission:export">
                    <i class="fa fa-download"></i> [[#{export}]]
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:commission:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:commission:remove')}]];
        var prefix = ctx + "business/commission";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: [[#{commissionDetails}]],
                columns: [{
                    checkbox: true
                },
                {
                    field: 'detailId',
                    title: '佣金明细id',
                    visible: false
                },
                {
                    field: 'transactionNumber',
                    title: [[#{transactionNo}]]
                },
                {
                    field: 'balance',
                    title: [[#{balance}]]
                },
                {
                    field: 'amount',
                    title: [[#{commission}]]
                },
                {
                    field: 'currency',
                    title: [[#{currency}]]
                },
                {
                    field: 'orderNo',
                    title: [[#{originalOrderNo}]]
                },
                {
                    field: 'orderAmount',
                    title: [[#{amount}]]
                },
                {
                    field: 'status',
                    title: [[#{status}]],
                    formatter: function(value, row, index) {
                        if(1==value){
                            return "收入"
                        } else if(2==value){
                            return "提现";
                        } else {
                            return value;
                        }
                    }
                },
                {
                    field: 'withdrawalAccount',
                    title: [[#{accountNumber}]]
                },
                {
                    field: 'withdrawalName',
                    title: [[#{accountName}]]
                },
                {
                    field: 'paymentTime',
                    title: [[#{paymentTime}]]
                },
                {
                    field: 'withdrawalStatus',
                    title: '提现状态',
                    formatter: function(value, row, index) {
                        if(1==value){
                            return "成功"
                        } else if(2==value){
                            return "失败";
                        } else {
                            return value;
                        }
                    }
                },
                {
                    field: 'createTime',
                    title: [[#{createTime}]]
                }]
            };
            $.table.init(options);
        });
    </script>

     <script th:inline="javascript">
         //获取应用路径
         var ROOT = [[${#servletContext.contextPath}]];

         //获取默认语言
         var LANG_COUNTRY = [[${#locale.language+'_'+#locale.country}]];

         //初始化i18n插件
         $.i18n.properties({
             path: ROOT + '/i18n/',//这里表示访问路径
             name: 'messages',//文件名开头
             language: LANG_COUNTRY,//文件名语言 例如en_US
             mode: 'map'//默认值
         });

         //初始化i18n函数
         function i18n(msgKey) {
             try {
                 return $.i18n.prop(msgKey);
             } catch (e) {
                 return msgKey;
             }
         }

         //获取国际化翻译值
         //console.log(i18n('supplier.name'));
     </script>
</body>
</html>